package br.pucrio.inf.lac.konoha.hyuga.core;

import java.util.EnumSet;

/** Hyuga's EPAs. */
public enum EPA {
    DEBUG, NONE,   
    // CSV OUTPUT
    CSVSTREAM,
    // CELL
    CELLCHECK, CELLCORE, CELLCLUSTER,
    // CELL TRANSIENT
    CELLTRANSIENT, CELLTRANSIENTCHECK, CELLTRANSIENTCLUSTER, 
    // CELL DISPERSION
    CELLDISPERSIONBYTIME, CELLCHANGED, CELLREMOVECHANGEDLU, CELLRECHECKTEST, CELLRECHECK, CELLDISPERSIONBYCHANGE,
    // CELL OUTPUT EPA
    CELLCLUSTERFORMOUT, CELLCLUSTERDISPOUT,
    // GRID CLUSTER AND MERGE
    GRIDMERGECHECK, GRIDMERGELOCK, GRIDMERGE, GRIDMERGEUNLOCK,
    // GRID DISPERSION
    GRIDDISPLOCK, GRIDDISPEXTRACT, GRIDDISPERSION, GRIDDISPUNLOCK,
    // GRID OUTPUT EPA
    FINALCLUSTER,
    // GRID SEMANTIC
    GRIDWINDOW, GRIDADD, GRIDUPDATE, GRIDMERGEOUTPUT, GRIDDISPOUTPUT; 
    
    public static EnumSet<EPA> ALL  = EnumSet.allOf(EPA.class);
    public static EnumSet<EPA> CSV  = EnumSet.of(CSVSTREAM);
    public static EnumSet<EPA> CELL = EnumSet.of(CELLCHECK, CELLCORE, CELLCLUSTER, 
                                                 CELLTRANSIENT, CELLTRANSIENTCHECK, CELLTRANSIENTCLUSTER, 
                                                 CELLDISPERSIONBYTIME, CELLCHANGED, CELLREMOVECHANGEDLU, CELLRECHECKTEST, CELLRECHECK, CELLDISPERSIONBYCHANGE,
                                                 CELLCLUSTERFORMOUT, CELLCLUSTERDISPOUT);
    public static EnumSet<EPA> GRID = EnumSet.of(GRIDMERGECHECK, GRIDMERGELOCK, GRIDMERGE, GRIDMERGEUNLOCK,
                                                 GRIDDISPLOCK, GRIDDISPEXTRACT, GRIDDISPERSION, GRIDDISPUNLOCK,
                                                 GRIDADD, GRIDUPDATE, GRIDMERGEOUTPUT, GRIDDISPOUTPUT);
    
    static {
        ALL = EnumSet.allOf(EPA.class);
        ALL.remove(GRIDWINDOW);
        ALL.remove(GRIDDISPUNLOCK);
//        ALL.remove(CELLCLUSTERDISPOUT);
    }
    
    public static EnumSet<EPA> getSet(String setName) {
        EnumSet<EPA> epaSet = null;
        switch (setName) {
            case "ALL":
                epaSet = EPA.ALL;
                break;
            case "CSV":
                epaSet = EPA.CSV;
                break;
            case "CELL":
                epaSet = EPA.CELL;
                break;
            case "GRID":
                epaSet = EPA.GRID;
                break;
            default:
                epaSet = EPA.ALL;
        }
        return epaSet;
    }
}